package com.frxuexi.department

import com.frxuexi.department.entity.DepartmentEntity
import com.frxuexi.lib_base.ApiResponse
import kotlinx.coroutines.flow.Flow
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

interface ApiService {

    @POST("/document/seldocuments")
    fun getDepartments(@Body body: RequestBody):Flow<ApiResponse<List<DepartmentEntity>>>


    @POST("/document/deldocuments")
    fun deleteDoc(@Body body: RequestBody):Flow<ApiResponse<List<DepartmentEntity>>>

    /**
     * 上传文件到服务器
     */
    @Multipart
    @POST("/fileUpload")
    fun uploadDoc(@Part data:List<MultipartBody.Part>):Flow<ApiResponse<List<DepartmentEntity>>>

    @POST("/document/uploaddocuments")
    fun addDoc(@Body body: RequestBody):Flow<ApiResponse<List<DepartmentEntity>>>

}